home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-20 | 1.9 KB | 93 lines | [TEXT/CWIE] |
- unit thebigpicture;
-
- interface
-
- procedure DrawBigPicture;
-
- implementation
-
- uses
- globals,
- LowMem,
- QuickDraw,
- Windows,
- Resources;
-
- type
- PICTinfo=record
- size:integer;
- frame:Rect;
- end;
- PICTinfoPtr=^PICTinfo;
- PICTinfoH=^PICTinfoPtr;
-
- procedure DrawBigPicture;
- var
- theH:integer;
- theWindow:WindowPtr;
- r,importRect:Rect;
- tempRgn,oldRgn:RgnHandle;
- RGBblueColor:RGBColor;
- thePic:PicHandle;
- begin
- with r do begin
- top:=0;
- bottom:=10;
- left:=0;
- right:=10;
- end;
- theWindow:=NewWindow(nil,r,'',false,noGrowDocProc,WindowPtr(-1),false,0);
- SetPort(theWindow);
- importRect:=qd.thePort^.portBits.bounds;
-
- theH:=GetMBarHeight;
- LMSetMBarHeight(0);
- SizeWindow(theWindow,importRect.right,importRect.bottom,false);
- ShowWindow(theWindow);
- MoveWindow(theWindow,0,0,true);
- tempRgn:=NewRgn;
- oldRgn:=NewRgn;
- CopyRgn(theWindow^.clipRgn,oldRgn);
- SetRectRgn(tempRgn,0,0,importRect.right,importRect.bottom);
- UnionRgn(tempRgn,oldRgn,theWindow^.clipRgn);
- theWindow^.visRgn:=theWindow^.clipRgn;
- ForeColor(blackColor);
- PaintRect(importRect);
- HideCursor;
-
- case GetControlValue(gTypePopUp) of
- 1: {BSOD} begin
- with RGBblueColor do begin
- red:=41*256;
- green:=65*256;
- blue:=240*256;
- end;
- RGBForeColor(RGBblueColor);
- PaintRect(importRect);
- end;
- 2,3: {GPF,CM} begin
- thePic:=GetPicture(2999+GetControlValue(gTypePopUp));
- with r do begin
- top:=importRect.bottom div 2 - PICTinfoH(thePic)^^.frame.bottom div 2;
- bottom:=top+PICTinfoH(thePic)^^.frame.bottom;
- left:=importRect.right div 2 - PICTinfoH(thePic)^^.frame.right div 2;
- right:=left+PICTinfoH(thePic)^^.frame.right;
- end;
- DrawPicture(thePic,r);
- ReleaseResource(Handle(thePic));
- end;
- end;
-
- while not Button do;
- FlushEvents(everyEvent - osMask - diskMask, 0);
-
- LMSetMBarHeight(theH);
- DisposeRgn(tempRgn);
- DisposeRgn(oldRgn);
- DisposeWindow(theWindow);
- SetPort(gMainWindow);
- ShowCursor;
- DrawMenuBar;
- end;
-
- end.